<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel"
    :maskClosable="false"
    :destroyOnClose="true"
    cancelText="关闭">
    <StdSampleScopeList ref="scopeList" ></StdSampleScopeList>
  </j-modal>
</template>

<script>

  export default {
    name: 'StdSampleScopeListModal',
    components: {
      StdSampleScopeList:()=> import('@/views/library/stdSample/StdSampleScopeList')
    },
    data () {
      return {
        title:'共享范围',
        width:'90%',
        visible: false,
        disableSubmit: false,
        customParam:{},
      }
    },
    methods: {
      add () {
        this.visible=true
        this.$nextTick(()=>{
          
          this.$refs.realForm.add();
        })
      },
      open (record) {
        this.visible=true
        this.title = '共享范围'
        this.$nextTick(()=>{
          this.$refs.scopeList.customParam = this.customParam
          if(!this.customParam.batchFlag){
             this.$refs.scopeList.loadData(1);
          }else{
            this.title = '批量设置共享范围'
          }
         
        })
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      handleOk () {
        this.visible = false;
      },
      submitCallback(){
        this.$emit('ok');
        this.visible = false;
      },
      handleCancel () {
        this.close()
      }
    }
  }
</script>